#include "widget.h"
#include <QApplication>

#if defined(Q_OS_WIN)
#if defined(_MSC_VER)
#include <vld.h>
#endif
#elif defined(Q_OS_MACOS)
#elif defined(Q_OS_LINUX)
#endif

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    // Set OpenGL Version information
    // Note: This format must be set before show() is called.
//    QSurfaceFormat format;
//    format.setRenderableType(QSurfaceFormat::OpenGL);
//    format.setProfile(QSurfaceFormat::CoreProfile);
//    format.setVersion(3, 3); // 注意：3.3版本的CoreProfile不支持vbo+ebo，不显示任何内容的！！CoreProfile下有不少区别和坑

    QSurfaceFormat format;
    format.setRenderableType(QSurfaceFormat::OpenGL);
    format.setProfile(QSurfaceFormat::CompatibilityProfile); // CompatibilityProfile支持vbo+ebo
    format.setVersion(3, 3);

    Widget w;
    w.setFormat(format);
    w.show();

    return a.exec();
}
